package com.subsequent.mapper;

import com.subsequent.entity.Medicines;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MedicinesMapper {
    // 分页+条件查询
    List<Medicines> selectByCondition(@Param("medicineName") String medicineName,
                                      @Param("isPrescription") Integer isPrescription,
                                      @Param("code") String code,
                                      @Param("status") Integer status,
                                      @Param("startTime") String startTime,
                                      @Param("endTime") String endTime);

    // 统计总数（分页用）
    int countByCondition(@Param("medicineName") String medicineName,
                         @Param("isPrescription") Integer isPrescription,
                         @Param("code") String code,
                         @Param("status") Integer status,
                         @Param("startTime") String startTime,
                         @Param("endTime") String endTime);

    Medicines selectById(Integer medicineId);

    int insert(Medicines medicines);

    int update(Medicines medicines);

    int deleteById(Integer medicineId);

}